#include <iostream>

using std::cout;
using std::endl;

class A
{
public:
    void print() const
    {   cout << "A::print()" << endl;   }
protected:
    int _data;
};


class B
{
public:
    void print() const
    {   cout << "B::print()" << endl;   }
protected:
    int _data;
};

class C
{
public:
    void print() const
    {   cout << "C::print()" << endl;   }
protected:
    int _data;
};

class D
: public A
//, B    //默认继承方式 private
, public B
, public C
{
public:
    void display() const 
    {
        cout << "A::_data" << A::_data << endl;
        cout << "B::_data" << B::_data << endl;
        cout << "C::_data" << C::_data << endl;
    }
};

int main()
{
    D d;
    //d.print();//成员名访问冲突的二义性问题
    d.A::print();//解决方案：采用类名+作用域限定符
    d.B::print();
    d.C::print();

    return 0;
}

